<%@page import="com.cchr.acms.model.CaseFollowUp"%>
<%@page import="com.cchr.acms.util.HtmlComponentUtil.SelectOption"%>
<%@page import="java.util.List"%>
<%@page import="com.cchr.acms.util.HtmlComponentUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"   pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.acms.com/acmstag" prefix="acms" %>
<%
	String contextPath = request.getContextPath();
%>
	
	<form class="panel form-horizontal" id="followup-form" method="POST" action="<%=contextPath %>/case/detail/${caseInfo.id }" style="width:1000px">
		<div class="row">
			<div class="col-sm-12">
				<div class="row">
					<div class="col-sm-12">
						<div class="form-group no-margin-hr">
							<label class="control-label"><h1 class="form-header" style="margin-bottom:10px; margin-top:10px">Has the
					 Abuse Case Been Contacted?</h1></label>
					 		<acms:yesNoSelect name="beenContacted" id="beenContacted" clazz="unRender" selected="${followup.beenContacted }"/>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row beenContacted-form">
			<div class="col-sm-2">
				<div class="form-group no-margin-hr">
					<label class="control-label">Date Contacted</label>
				</div>
			</div>
			<div class="col-sm-3">
				<div class="input-group date bs-datepicker-component">
					<input type="text" class="form-control" name="contactedDate" value="<fmt:formatDate value="${followup.contactedDate}" pattern="MM/dd/yyyy"/>"><span class="input-group-addon"><i class="fa fa-calendar"></i></span>
				</div>
			</div>
		</div>
		<div class="row beenContacted-form">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label"><h1 class="form-header" style="margin-bottom:10px; margin-top:10px">By Who?</h1></label>
				</div>
			</div>
		</div>
		<div class="row beenContacted-form">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="checkbox-inline">
						<c:choose>
							<c:when test="${followup.followedType == '0' or empty followup.followedType }">
								<input type="radio" id="internationlType" class="px" value="0" name="followedType" checked>
							</c:when>
							<c:otherwise>
								<input type="radio" id="internationlType" class="px" value="0" name="followedType">
							</c:otherwise>
						</c:choose>
						 <span class="lbl">CCHR International</span>
					</label>			
				</div>
			</div>
		</div>
		<div class="row beenContacted-form" id="internationlArea">
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-5">
						<div class="form-group no-margin-hr">
							<label class="control-label">Staff Member First Name:</label>
						</div>
					</div>
					<div class="col-sm-6">
						<input type="text" class="form-control" id="staffMemeberFirstName1" name="staffMemeberFirstName1" value="${followup.staffMemeberFirstName1 }" >
					</div>
				</div>
			</div>
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-5">
						<div class="form-group no-margin-hr">
							<label class="control-label">Staff Member Last Name:</label>
						</div>
					</div>
					<div class="col-sm-6">
						<input type="text" class="form-control" id="staffMemeberLastName1" name="staffMemeberLastName1"  value="${followup.staffMemeberLastName1 }">
					</div>
				</div>
			</div>
		</div>
		<div class="row beenContacted-form">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="checkbox-inline">
						<c:choose>
							<c:when test="${followup.followedType == '1' }">
								<input type="radio" id="chapterType" class="px" value="1" name="followedType" checked>
							</c:when>
							<c:otherwise>
								<input type="radio" id="chapterType" class="px" value="1" name="followedType">
							</c:otherwise>
						</c:choose>
						 <span class="lbl">CCHR Chapter</span>
					</label>			
				</div>
			</div>
		</div>
		<div class="row beenContacted-form" id="chapterArea" style="display: none;" >
			<div class="col-sm-4">
				<div class="form-group no-margin-hr">
					<label class="control-label">Which Chapter?</label>
					<input type="text" class="form-control" id="chapter" name="chapter" value="${followup.chapter }" >
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group no-margin-hr">
					<label class="control-label">Staff Member First Name</label>
					<input type="text" class="form-control" id="staffMemeberFirstName2" name="staffMemeberFirstName2"  value="${followup.staffMemeberFirstName2 }">
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group no-margin-hr">
					<label class="control-label">Staff Member Last Name</label>
					<input type="text" class="form-control" id="staffMemeberLastName2" name="staffMemeberLastName2"  value="${followup.staffMemeberLastName2 }" >
				</div>
			</div>
		</div>
		<div class="row beenContacted-form">
			<div class="col-sm-2">
				<div class="form-group no-margin-hr">
					<label class="control-label">Contacted by:</label>				
				</div>
			</div>
			<c:forEach var="contact" items="${contactWays }">  
	     			<div class="col-sm-2">
						<div class="form-group no-margin-hr">
							<label class="checkbox-inline">
								<c:choose>
									<c:when test="${fn:contains(followup.contactedBy, contact)}">
										<input type="checkbox" class="px" value="${contact }" name="contactWaysCheckbox" checked="checked"> 
									</c:when>
									<c:otherwise>
										<input type="checkbox" class="px" value="${contact }" name="contactWaysCheckbox"> 
									</c:otherwise>
								</c:choose>
								<span class="lbl">${contact }</span>
							</label>			
						</div>
					</div> 
   			</c:forEach> 
		</div>
		<div class="row beenContacted-form">
			<div class="col-sm-4">
				<div class="form-group no-margin-hr">
					<label class="control-label">Email</label>
					<input type="text" class="form-control" id="staffMemeberEmail" name="staffMemeberEmail" value="${followup.staffMemeberEmail }" >
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group no-margin-hr">
					<label class="control-label">Phone Number</label>
					<input type="text" class="form-control" id="staffMemeberPhoneNumber" name="staffMemeberPhoneNumber"  value="${followup.staffMemeberPhoneNumber }">
				</div>
			</div>
		</div>
		<div class="row beenContacted-form">
			<div class="col-sm-1">
				<div class="form-group no-margin-hr">
					<label class="control-label">Notes</label>				
				</div>
			</div>
			<div class="col-sm-11">
				<div class="form-group no-margin-hr">
					<textarea rows="3" class="form-control" name="contactedNotes">${followup.contactedNotes }</textarea>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
				<label class="control-label"><h1 class="form-header" style="margin-bottom:10px; margin-top:10px">Did the Abused Person Use Insurance?</h1></label>
					<acms:yesNoSelect name="userInsurance" id="userInsurance" clazz="unRender" selected="${followup.userInsurance }"/>
				</div>
			</div>
		</div>
		<div class="row userInsurance-form">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label"><h1 class="form-header" style="margin-bottom:10px; margin-top:10px">What Type Was Used?</h1></label>
				</div>
			</div>
		</div>
		<div class="row userInsurance-form">
			<c:forEach var="type" items="${insuranceType }">  
	     			<div class="col-sm-3">
						<div class="form-group no-margin-hr">
							<label class="checkbox-inline">
								<c:choose>
									<c:when test="${fn:contains(followup.insuranceType, type)}">
										<input type="checkbox" class="px" value="${type }" name="insuranceTypeCheckbox" checked="checked"> 
									</c:when>
									<c:otherwise>
										<input type="checkbox" class="px" value="${type }" name="insuranceTypeCheckbox"> 
									</c:otherwise>
								</c:choose>
								<span class="lbl">${type }</span>
							</label>			
						</div>
					</div> 
   			</c:forEach>			
		</div>
		<div class="row userInsurance-form">
			<div class="col-sm-12">
				<div class="row">
					<div class="col-sm-3">
						<div class="form-group no-margin-hr">
							<label class="control-label">Insurance Company Name:</label>
						</div>
					</div>
					<div class="col-sm-9">
						<input type="text" class="form-control" name="insurance1CompanyName" value="${followup.insurance1CompanyName }" placeholder="Insurance Company Name">
					</div>
				</div>
			</div>
		</div>
		<div class="row userInsurance-form">
			<div class="col-sm-3">
				<div class="form-group no-margin-hr">
					<label class="control-label">Notes on Insurance Details</label>				
				</div>
			</div>
			<div class="col-sm-9">
				<div class="form-group no-margin-hr">
					<textarea rows="3" class="form-control" name="notesOnInsuranceDetail">${followup.notesOnInsuranceDetail }</textarea>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label"><h1 class="form-header" style="margin-bottom:10px; margin-top:10px">Attorney Status:</h1></label>
				</div>
			</div>
		</div>
		<div class="row">
			<c:forEach var="type" items="${attorneyStatus }">  
	     			<div class="col-sm-4">
						<div class="form-group no-margin-hr">
							<label class="checkbox-inline">
								<c:choose>
									<c:when test="${fn:contains(followup.attorneyStatus, type)}">
										<input type="checkbox" class="px" value="${type }" name="attorneyStatusCheckbox" checked="checked"> 
									</c:when>
									<c:otherwise>
										<input type="checkbox" class="px" value="${type }" name="attorneyStatusCheckbox">
									</c:otherwise>
								</c:choose>
								<span class="lbl">${type }</span>
							</label>			
						</div>
					</div> 
   			</c:forEach>
		</div>
		<div class="row">
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-6">
						<div class="form-group no-margin-hr">
							<label class="control-label">Attorney First Name</label>
						</div>
					</div>
					<div class="col-sm-6">
						<input type="text" class="form-control" name="attorneyFirstName" value="${followup.attorneyFirstName }" placeholder="Attorney First Name">
					</div>
				</div>
			</div>
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-6">
						<div class="form-group no-margin-hr">
							<label class="control-label">Attorney Last Name</label>
						</div>
					</div>
					<div class="col-sm-6">
						<input type="text" class="form-control" name="attorneyLastName" value="${followup.attorneyLastName }" placeholder="Attorney Last Name">
					</div>
				</div>
			</div>
		</div>
		 <div class="row">
			<div class="col-sm-3">
				<div class="form-group no-margin-hr">
					<label class="control-label">Notes on Attorney status</label>				
				</div>
			</div>
			<div class="col-sm-9">
				<div class="form-group no-margin-hr">
					<textarea rows="3" class="form-control" name="notesOnAttorneyStatus">${followup.notesOnAttorneyStatus }</textarea>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label"><h1 class="form-header" style="margin-bottom:10px; margin-top:10px">Abuse Case Referred to Attorney?</h1></label>
					<acms:yesNoSelect name="referAttorneyStatus" id="referAttorneyStatus" clazz="unRender" selected="${followup.referAttorneyStatus }"/>
				</div>
			</div>
		</div>
		<div class="row referAttorneyStatus-form">
			<div class="col-sm-4">
				<div class="form-group no-margin-hr">
					<label class="control-label">Attorney First Name</label>
					<input type="text" class="form-control" name="referAttorneyFirstName" value="${followup.referAttorneyFirstName }" placeholder="Attorney First Name">
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group no-margin-hr">
					<label class="control-label">Attorney Last Name</label>
					<input type="text" class="form-control" name="referAttorneyLastName" value="${followup.referAttorneyLastName }" placeholder="Attorney Last Name">
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group no-margin-hr">
					<label class="control-label">Date Referred</label>
					<div class="input-group date bs-datepicker-component">
						<input type="text" class="form-control" name="referAttorneyDate" value="<fmt:formatDate value="${followup.referAttorneyDate }" pattern="MM/dd/yyyy"/>"><span class="input-group-addon"><i class="fa fa-calendar"></i></span>
					</div>
				</div>
			</div>
		</div>
		<div class="row referAttorneyStatus-form">
			<div class="col-sm-6">
				<div class="row col-sm-12">
					<div class="form-group no-margin-hr">
						<label class="checkbox-inline">
							<c:choose>
								<c:when test="${followup.referAttorneyAccteptFlag == '1'}">
									<input type="checkbox" class="px ferAttorneyCheck" id="referAttorneyAccteptFlag" name="referAttorneyAccteptFlag" value="1" checked="checked"> 
								</c:when>
								<c:otherwise>
									<input type="checkbox" class="px ferAttorneyCheck" id="referAttorneyAccteptFlag" name="referAttorneyAccteptFlag" value="1"> 
								</c:otherwise>
							</c:choose>
							<span class="lbl">Accepted by attorney</span>
						</label>			
					</div>
				</div>
			</div>
			<div class="col-sm-6">
				<div class="row col-sm-12">
					<div class="form-group no-margin-hr">
						<label class="checkbox-inline">
						<c:choose>
							<c:when test="${followup.referAttorneyDeclinedFlag == '1'}">
								<input type="checkbox" class="px ferAttorneyCheck" id="referAttorneyDeclinedFlag" name="referAttorneyDeclinedFlag" value="1" checked="checked"> 
							</c:when>
							<c:otherwise>
								<input type="checkbox" class="px ferAttorneyCheck" id="referAttorneyDeclinedFlag" name="referAttorneyDeclinedFlag" value="1"> 
							</c:otherwise>
						</c:choose>
						<span class="lbl">Declined by attorney</span>
						</label>			
					</div>
				</div>
			</div>
		</div>
		<div class="row referAttorneyStatus-form referAttorneyAccteptFlag-form">
			<div class="col-sm-3">
				<div class="form-group no-margin-hr">
					<label class="control-label">Date Accepted</label>
				</div>
			</div>
			<div class="col-sm-3">
				<div class="input-group date bs-datepicker-component">
					<input type="text" class="form-control" name="referAttorneyAccteptDate" value="<fmt:formatDate value="${followup.referAttorneyAccteptDate }" pattern="MM/dd/yyyy"/>"><span class="input-group-addon"><i class="fa fa-calendar"></i></span>
				</div>
			</div>
		</div>
		<div class="row referAttorneyStatus-form referAttorneyDeclinedFlag-form">
			<div class="col-sm-3">
				<div class="form-group no-margin-hr">
					<label class="control-label">Date Declined</label>
				</div>
			</div>
			<div class="col-sm-3">
				<div class="input-group date bs-datepicker-component">
					<input type="text" class="form-control" name="referAttorneyDeclinedDate" value="<fmt:formatDate value="${followup.referAttorneyDeclinedDate }" pattern="MM/dd/yyyy"/>"><span class="input-group-addon"><i class="fa fa-calendar"></i></span>
				</div>
			</div>
		</div>
		<div class="row referAttorneyStatus-form referAttorneyDeclinedFlag-form">
			<div class="col-sm-3">
				<div class="form-group no-margin-hr">
					<label class="control-label">Reason, if given</label>
				</div>
			</div>
			<div class="col-sm-9">
				<textarea rows="3" class="form-control" name="referAttorneyDeclinedReason">${followup.referAttorneyDeclinedReason }</textarea>
			</div>
		</div>
		<div class="row referAttorneyStatus-form">
			<div class="col-sm-3">
				<div class="form-group no-margin-hr">
					<label class="control-label">Notes on Attorney Referral</label>				
				</div>
			</div>
			<br /> 
			<div class="col-sm-9">
				<div class="form-group no-margin-hr">
					<textarea rows="3" class="form-control" name="notesOnReferal">${followup.notesOnReferal }</textarea>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label"><h1 class="form-header" style="margin-bottom:10px; margin-top:10px">Has a Complaint Been Filed on This Abuse?</h1></label>
					<acms:yesNoSelect name="filledWithAgency" id="filledWithAgency" clazz="unRender" selected="${followup.filledWithAgency }"/>
				</div>
			</div>
		</div>
		<div class="row filledWithAgency-form">
			<div class="col-sm-2">
				<div class="form-group no-margin-hr">
					<label class="control-label">Date Field</label>
				</div>
			</div>
			<div class="col-sm-3">
				<div class="input-group date bs-datepicker-component">
					<input type="text" name="filleWithAgencyDate" class="form-control" value="<fmt:formatDate value="${followup.filleWithAgencyDate }" pattern="MM/dd/yyyy"/>"><span class="input-group-addon"><i class="fa fa-calendar"></i></span>
				</div>
			</div>
		</div>
		<div class="row filledWithAgency-form">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label"><h1 class="form-header" style="margin-bottom:10px; margin-top:10px">Agency the Complaint Was Filed With:</h1></label>
				</div>
			</div>
		</div>
		<div class="row filledWithAgency-form">
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-4">
						<div class="form-group no-margin-hr">
							<label class="control-label">Agency Name</label>
						</div>
					</div>
					<div class="col-sm-8">
						<div class="form-group no-margin-hr">
							<input type="text" class="form-control" name="filledAgencyName" placeholder="Agency Name" value="${followup.filledAgencyName }">
						</div>
					</div>
				</div>
			</div>
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-4">
						<div class="form-group no-margin-hr">
							<label class="control-label">Contact Name</label>
						</div>
					</div>
					<div class="col-sm-8">
						<div class="form-group no-margin-hr">
							<input type="text" class="form-control" name="filledAgencyContactName" placeholder="Contact Name" value="${followup.filledAgencyContactName }">
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row filledWithAgency-form">
			<div class="col-sm-4">
				<div class="row">
					<div class="col-sm-5">
						<div class="form-group no-margin-hr">
							<label class="control-label">Street Address</label>
						</div>
					</div>
					<div class="col-sm-7">
						<div class="form-group no-margin-hr">
							<input type="text" class="form-control" name="filledAgencyAddress" placeholder="Street Address" value="${followup.filledAgencyAddress }">
						</div>
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="row">
					<div class="col-sm-5">
						<div class="form-group no-margin-hr">
							<label class="control-label">City/Province</label>
						</div>
					</div>
					<div class="col-sm-7">
						<div class="form-group no-margin-hr">
							<input type="text" class="form-control" name="filledAgencyCity" placeholder="City/Province" value="${followup.filledAgencyCity }">
						</div>
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="row">
					<div class="col-sm-5">
						<div class="form-group no-margin-hr">
							<label class="control-label">State</label>
						</div>
					</div>
					<div class="col-sm-7">
						<div class="form-group no-margin-hr">
							<input type="text" class="form-control" name="filledAgencyState" placeholder="State" value="${followup.filledAgencyState }">
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row filledWithAgency-form">
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-4">
						<div class="form-group no-margin-hr">
							<label class="control-label">Zip/Postal Code</label>
						</div>
					</div>
					<div class="col-sm-8">
						<div class="form-group no-margin-hr">
							<input type="text" class="form-control" name="filledAgencyZip" placeholder="Zip/Postal Code" value="${followup.filledAgencyZip }">
						</div>
					</div>
				</div>
			</div>
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-4">
						<div class="form-group no-margin-hr">
							<label class="control-label">Country</label>
							
						</div>
					</div>
					<div class="col-sm-8">
						<div class="form-group no-margin-hr">
							<%= HtmlComponentUtil.getSelect("filledAgencyCountry", "filledAgencyCountry", (List<SelectOption>)request.getAttribute("countryDatas"), ((CaseFollowUp)request.getAttribute("followup")).getFilledAgencyCountry(), "choose country...") %>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row filledWithAgency-form">
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-8">
						<div class="form-group no-margin-hr">
							<label class="control-label">Was a Response Received on the Complaint?</label>
						</div>
					</div>
					<div class="4">
						<acms:yesNoSelect name="compliantResponseReceived" clazz="unRender" selected="${followup.compliantResponseReceived }"/>
					</div>
				</div>
			</div>
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-5">
						<div class="form-group no-margin-hr">
							<label class="control-label">What Was the Response?</label>				
						</div>
					</div>
					<div class="col-sm-7">
						<div class="form-group no-margin-hr">
							<textarea rows="3" class="form-control" name="compliantResponseContent">${followup.compliantResponseContent }</textarea>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row filledWithAgency-form">
			<div class="col-sm-4">
				<div class="form-group no-margin-hr">
					<label class="control-label">Notes on Complaint Filed?</label>				
				</div>
			</div>
			<div class="col-sm-8">
				<div class="form-group no-margin-hr">
					<textarea rows="3" class="form-control" name="noteOnCompliant">${followup.noteOnCompliant }</textarea>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-10">
						<div class="form-group no-margin-hr">
							<label class="control-label">Has the Abused Person Signed a General Waiver?</label>
						</div>
					</div>
					<div class="col-sm-2">
						<acms:yesNoSelect id="abusedPersonSigneWaiver" clazz="unRender" name="abusedPersonSigneWaiver" selected="${followup.abusedPersonSigneWaiver }"/>
					</div>
				</div>
			</div>
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-3">
						<div class="form-group no-margin-hr">
							<label class="control-label">Date Signed</label>
						</div>
					</div>
					<div class="col-sm-8">
						<div class="input-group date bs-datepicker-component">
							<input type="text" class="form-control abusedPersonSigneWaiver-form" name="abusedPersonSigneDate" value="<fmt:formatDate value="${followup.abusedPersonSigneDate }" pattern="MM/dd/yyyy"/>"><span class="input-group-addon"><i class="fa fa-calendar"></i></span>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-10">
						<div class="form-group no-margin-hr">
							<label class="control-label">Has CCHR Received Documents From the Abused? </label>
						</div>
					</div>
					<div class="col-sm-2">
						<acms:yesNoSelect id="cchrReceivedAbusedDoc" clazz="unRender" name="cchrReceivedAbusedDoc" selected="${followup.cchrReceivedAbusedDoc }"/>
					</div>
				</div>
			</div>
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-3">
						<div class="form-group no-margin-hr">
							<label class="control-label">Date Received</label>
						</div>
					</div>
					<div class="col-sm-8">
						<div class="input-group date bs-datepicker-component">
							<input type="text" class="form-control cchrReceivedAbusedDoc-form" name="cchrReceivedAbusedDocDate" value="<fmt:formatDate value="${followup.cchrReceivedAbusedDocDate }" pattern="MM/dd/yyyy"/>"><span class="input-group-addon"><i class="fa fa-calendar"></i></span>
						</div>
					</div>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-4">
				<div class="form-group no-margin-hr">
					<label class="control-label">Other Actions Taken on the Case</label>				
				</div>
			</div>
			<div class="col-sm-8">
				<div class="form-group no-margin-hr">
					<textarea rows="3" class="form-control" name="otherActionsTaken">${followup.otherActionsTaken }</textarea>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-4">
				<div class="form-group no-margin-hr">
					<label class="control-label">Current Status of the Case</label>				
				</div>
			</div>
			<div class="col-sm-8">
				<div class="form-group no-margin-hr">
					<textarea rows="3" class="form-control" name="currentStatusOnCase">${followup.currentStatusOnCase }</textarea>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-8">
				<div class="row">
					<div class="col-sm-4">
						<div class="form-group no-margin-hr">
							<label class="control-label">Date Case Was Last Updated</label>
						</div>
					</div>
					<div class="col-sm-8">
						<div class="input-group date bs-datepicker-component">
							<input type="text" class="form-control" name="caseLastUpdatedDate" value="<fmt:formatDate value="${followup.caseLastUpdatedDate }" pattern="MM/dd/yyyy"/>"><span class="input-group-addon"><i class="fa fa-calendar"></i></span>
						</div>
					</div>
				</div>
			</div>
			<div class="col-sm-3">
				<div class="row">
					<div class="col-sm-6">
						<div class="form-group no-margin-hr">
							<label class="control-label">Case Category </label>
						</div>
					</div>
					<div class="col-sm-6">
						<div class="form-group no-margin-hr">
							<select class="form-control" name="caseCategory">
								<c:forEach var="type" items="${caseCategory }">  
										<c:choose>
											<c:when test="${followup.caseCategory == type.value}">
												<option value="${type.value }" selected="selected">${type.label }</option> 
											</c:when>
											<c:otherwise>
												<option value="${type.value }">${type.label }</option> 
											</c:otherwise>
										</c:choose>
					   			</c:forEach>
							</select>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-8">
				<div class="row">
					<div class="col-sm-4">
						<div class="form-group no-margin-hr">
							<label class="control-label">Case Status</label>
						</div>
					</div>
					<div class="col-sm-8">
						<div class="form-group no-margin-hr">
							<select name="caseStatus" id="caseStatus">
								<c:forEach var="status" items="${caseStatus }">  
									<c:choose>
										<c:when test="${caseInfo.status == status.value}">
											<option value="${status.value }" selected="selected">${status.key }</option> 
										</c:when>
										<c:otherwise>
											<option value="${status.value }">${status.key }</option> 
										</c:otherwise>
									</c:choose>
				   				</c:forEach>	
							</select>
						</div>
					</div>
				</div>
			</div>
		</div>
		<br>
		<div class="row">
			<div class="col-sm-3">
			</div>
			<div class="col-sm-6" style="text-align:center;">
				<input id="submitButton" type="button" value="Submit" style="width:120px;" class="btn btn-primary btn-lg">
			</div>
			<div class="col-sm-3">
			</div>
		</div>
	</form>


	<div id="uidemo-modals-alerts-success" class="modal modal-alert modal-success fade">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<i class="fa fa-check-circle"></i>
				</div>
				<div class="modal-title">Are you sure you want to submit?</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-success submitConfim">Yes</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">No</button>
				</div>
			</div> <!-- / .modal-content -->
		</div> <!-- / .modal-dialog -->
	</div> <!-- / .modal -->
	
	
	<div id="uidemo-modals-alerts-warning" class="modal modal-alert modal-warning fade">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<i class="fa fa-warning"></i>
				</div>
				<div class="modal-title">Is this case completed and can be closed from editing?</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-warning submitConfim" style="width:110px;">Yes</button>
					<button type="button" class="btn btn-default"  style="width:110px;" data-dismiss="modal">No</button>
				</div>
			</div> <!-- / .modal-content -->
		</div> <!-- / .modal-dialog -->
	</div> <!-- / .modal -->
	


<!-- Javascript -->
	<script>
		init.push(function () {

			var options2 = {
					orientation: $('body').hasClass('right-to-left') ? "auto right" : 'auto auto',
					autoclose: true
				};
			$('.bs-datepicker-component').datepicker(options2);
			
			function internationlTypeClick(e)
			{
				if(e.prop("checked")){
					$("#internationlArea").show();
					$("#chapterArea").hide();
					$("#chapter").val("");
					$("#staffMemeberFirstName2").val("");
					$("#staffMemeberLastName2").val("");
					$("#staffMemeberFirstName2").attr("disabled","diabled");
					$("#staffMemeberLastName2").attr("disabled","diabled");
					$("#staffMemeberFirstName1").removeAttr("disabled");
					$("#staffMemeberLastName1").removeAttr("disabled");
					
				}
			}
			
			function chapterTypeClick(e)
			{
				if(e.prop("checked")){
					$("#chapterArea").show();
					$("#internationlArea").hide();
					$("#staffMemeberFirstName1").val("");
					$("#staffMemeberLastName1").val("");
					$("#staffMemeberFirstName1").attr("disabled","diabled");
					$("#staffMemeberLastName1").attr("disabled","diabled");
					$("#staffMemeberFirstName2").removeAttr("disabled");
					$("#staffMemeberLastName2").removeAttr("disabled");
				}
			}
			
			$("#internationlType").click(function(){  
				internationlTypeClick($(this));
		     }); 
			
			$("#chapterType").click(function(){  
				chapterTypeClick($(this));
		      }); 
			
			$("#caseStatus").select2({
			  	placeholder: "Select a status",
			  	minimumResultsForSearch: -1,
			  	allowClear: true
			});
			
			$("#filledAgencyCountry").addClass('form-control').select2({
			  	placeholder: "Select a Country",
			  	allowClear: true
			});
			
			$('#submitButton').click(function(){
				if($('#caseStatus').val() == "5")
				{
					$('#uidemo-modals-alerts-warning').modal('show');
				}
				else
				{
					$('#uidemo-modals-alerts-success').modal('show');
				}
			});
			
			$('.submitConfim').click(function(){
				$("#followup-form").submit();
			});
			
			$("#followup-form").validate({
				ignore: '.ignore',
				focusInvalid: true,
				rules: {
					'caseStatus': {
						required: true
					}
				}
			});
			
			
			function showOrHide(target, clazz)
			{
				if($(target).val() == '0')
				{
					$(clazz).hide();
				}
				else
				{
					$(clazz).show();
					// 设置默认followedType值
					if('.beenContacted-form' == clazz)
					{
						internationlTypeClick($("#internationlType"));
						chapterTypeClick($("#chapterType"));
					}
				}
			}
			
			$('#beenContacted').change(function(){
				showOrHide(this, '.beenContacted-form');
			});
			$('#userInsurance').change(function(){
				showOrHide(this, '.userInsurance-form');
			});
			$('#referAttorneyStatus').change(function(){
				showOrHide(this, '.referAttorneyStatus-form');
			});
 			$('#filledWithAgency').change(function(){
 				showOrHide(this, '.filledWithAgency-form');
			});
 			showOrHide($('#beenContacted'), '.beenContacted-form');
 			showOrHide($('#userInsurance'), '.userInsurance-form');
 			showOrHide($('#referAttorneyStatus'), '.referAttorneyStatus-form');
 			showOrHide($('#filledWithAgency'), '.filledWithAgency-form');
 			
 			function activeOrDisable(target, clazz)
			{
				if($(target).val() == '0')
				{
					$(clazz).attr("disabled", "disabled");
					$(clazz).val("");
				}
				else
				{
					$(clazz).removeAttr("disabled");
				}
			}
 			
 			$('#abusedPersonSigneWaiver').change(function(){
 				activeOrDisable(this, '.abusedPersonSigneWaiver-form');
			});
 			$('#cchrReceivedAbusedDoc').change(function(){
 				activeOrDisable(this, '.cchrReceivedAbusedDoc-form');
			});
 			activeOrDisable($('#abusedPersonSigneWaiver'), '.abusedPersonSigneWaiver-form');
 			activeOrDisable($('#cchrReceivedAbusedDoc'), '.cchrReceivedAbusedDoc-form');

 			function ferAttorneyCheckEvent(id){
 				var arr = ['referAttorneyAccteptFlag', 'referAttorneyDeclinedFlag'];
 				if(id == null)
 				{
 					for(var i=0; i<arr.length; i++)
 					{
 						if($('#' + arr[i])[0].checked)
 						{
 							id = arr[i];
 							break;
 						}
 					}
 				}
 				if(!id)
 				{
 	 				id = '';
 				}
 				if($('#' + id).length>0)
 				{
 	 				if($('#' + id)[0].checked)
 	 	 			{
 	 					$('.' + id + '-form').show();
 	 					for(var i=0; i<arr.length; i++)
 	 					{
 	 						if(arr[i] != id)
 	 						{
 	 							$('#' + arr[i])[0].checked = false;
 	 							$('.' + arr[i] + '-form').hide();
 	 						}
 	 					}
 	 	 	 		}
 	 				else
 	 	 			{
 	 					$('.' + id + '-form').hide();
 	 	 	 	 	}
 				}
 				else
 				{
 					for(var i=0; i<arr.length; i++)
 					{
						$('.' + arr[i] + '-form').hide();
 					}
 				}
 			}
 			
 			$('.ferAttorneyCheck').click(function(){
 				ferAttorneyCheckEvent($(this).attr('id'));
 	 		});

 			ferAttorneyCheckEvent();

			
		});
	</script>
